package hsl.study.videocapturesystem.config;


import hsl.study.videocapturesystem.test.VideoCaptureSystem;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Author: hsl
 * @CreateDate: 2025/7/29 9:35
 * @Version: 1.0
 */

@Configuration
@Component
public class VideoCaptureSystemConfig {

    @Resource
    private VideoCaptureProperties videoCaptureProperties;

    @Value("${VideoCaptureSystem.videoUrl}")
    private String videoUrl;

    @Value("${VideoCaptureSystem.outputDir}")
    private String outputDir;

    @Value("${VideoCaptureSystem.frequency}")
    private int frequency;

    @Value("${VideoCaptureSystem.queueCapacity}")
    private int queueCapacity;

    @Value("${VideoCaptureSystem.aiResultFile}")
    private String aiResultFile;

    @Bean
    public VideoCaptureSystem videoCaptureSystem() {
        return new VideoCaptureSystem(
                videoCaptureProperties.getVideoUrl(),
                videoCaptureProperties.getOutputDir(),
                videoCaptureProperties.getFrequency(),
                videoCaptureProperties.getQueueCapacity()
        );
    }
}
